const log = console.log

/**
 * MODE 定义开发环境
 */
const MODE = 'dev'

/**
 * ENV_LIST                     所有可选开发环境(MODE为空的情况下默认使用dev环境)
 * --- ENVNAME                  开发环境名称
 * --- BASEURL                  该环境下面的 API 请求的域名
 */
const ENV_LIST = [
    {
       ENVNAME: 'dev',
       // BASEURL: `https://lm.apemoon.com/api/`,
       BASEURL: `http://hjcy.apemoon.com/prod-api/`,
       WebSocketURl: `ws://ec2-13-36-229-106.eu-west-3.compute.amazonaws.com:8888/`
    },
    {
        // 测试环境
		ENVNAME: 'test',
		BASEURL: `http://192.168.2.28:8888`,
		WebSocketURl: `ws://192.168.2.28:8888/`
    },
    {
        // 生产环境
        ENVNAME: 'prod',
        BASEURL: `http://hjcy.apemoon.com/prod-api/`,
        WebSocketURl: `ws://ec2-13-36-229-106.eu-west-3.compute.amazonaws.com:8888/`
    },
]

var CONFIG = ENV_LIST.find(item => item.ENVNAME === MODE) || ENV_LIST[0]
if (!CONFIG.BASEURL) { throw(`请为${CONFIG.envName}环境添加baseUrl`) }

log(`Development environment: %c${CONFIG.ENVNAME}`, "color: green")
log(`Interface environment: ${CONFIG.BASEURL}`)

module.exports = CONFIG
